import http from '../../utils/request/request'
const ROOT = '/processing/processing-job'

// 获取所有作业信息（分页）
export function getAllInfoByPage(factoryId, current = 1, size = 5, value = '') {
    let RootUrl = `${ROOT}/factory/${factoryId}/page/${current}/${size}`
    let url = value ? `${RootUrl}/key/${value}` : `${RootUrl}`;
    return http({
        url,
        method: 'get'
    })
}

// 通过id查询作业信息
export function getInfoById(id) {
    return http({
        url: `${ROOT}/${id}`,
        method: 'get'
    })
}

// 添加
export function addInfo(data) {
    return http({
        url: `${ROOT}/`,
        method: 'post',
        data,
    })
}

// 删除
export function delInfoById(id) {
    return http({
        url: `${ROOT}/${id}`,
        method: 'delete'
    })
}

// 修改
export function editInfo(data) {
    return http({
        url: `${ROOT}/`,
        method: 'put',
        data,
    })
}

